--------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/TJRyan/Dropbox/Summer work/Kinder/Replication files/panel_coding.log
  log type:  text
 opened on:  11 Aug 2015, 11:36:23

. do "/Users/TJRyan/Dropbox/Summer work/Kinder/Replication files/panel_coding.do"

. * This file creates the Panel working dataset used Kinder and Ryan, "Prejudice and Politic
> s Re-examined"
. * Analysis was conducted on State/SE 13.1 for Mac (64-bit Intel) 
. 
. * Load raw data
. use "anes2008_2009panel_dataset.dta", clear

. 
. * Merge in IAT scores
. * Scores available from http://electionstudies.org/studypages/2008_2009panel/IATscores.zip
. sort caseid

. merge caseid using "iat.dta", unique sort
(note: you are using old merge syntax; see [D] merge for new syntax)
(note: variable caseid was float, now double to accommodate using data's values)

. 
. * Race
. gen white = 0

. replace white = 1 if der04==1
(3292 real changes made)

. gen black = 0

. replace black = 1 if der04==2
(492 real changes made)

. gen hispanic = 0

. replace hispanic = 1 if der04==3
(275 real changes made)

. 
. * Gender
. gen female = 0

. replace female = 1 if der01==2
(2442 real changes made)

. 
. * Age
. gen age = (der02 - 18 ) / 72

. rename der02 age2

. gen agebin = .
(4240 missing values generated)

. replace agebin = 0 if (age2<30)
(439 real changes made)

. replace agebin = 1 if (age2>=30) & (age2<=39)
(637 real changes made)

. replace agebin = 2 if (age2>=40) & (age2<=49)
(883 real changes made)

. replace agebin = 3 if (age2>=50) & (age2<=59)
(1018 real changes made)

. replace agebin = 4 if (age2>=60) & (age2<=69)
(744 real changes made)

. replace agebin = 5 if (age2>=70) & (age2<=79)
(361 real changes made)

. replace agebin = 6 if (age2>=80) & (age2<=99)
(158 real changes made)

. recode agebin (5 = 4) (6 = 4), gen(agebin2)
(519 differences between agebin and agebin2)

. 
. * Vote choice
. gen mcvote = .
(4240 missing values generated)

. replace mcvote = 1 if der16==1
(1108 real changes made)

. replace mcvote = 0 if der16==2
(1270 real changes made)

. replace mcvote = . if der15==2 // Remove nonvoters
(3 real changes made, 3 to missing)

. 
. * Primary vote choice
. gen primvote = .
(4240 missing values generated)

. replace primvote = 0 if der14==2 // Obama voters
(446 real changes made)

. replace primvote = 1 if der14==1 | (der14>2 & der14<10) // Another Democrat
(498 real changes made)

. replace primvote = 1 if der13>0 & der13<11 // A Republican
(586 real changes made)

. replace primvote = . if der10a==1
(19 real changes made, 19 to missing)

. 
. * PID: Start with least desirable wave, and gradually replace with best (closest to electi
> on) one, if available.
. gen pidr = .
(4240 missing values generated)

. 
. replace pidr = 0 if der08w1 == 0
(327 real changes made)

. replace pidr = 1 if der08w1 == 1 | der08w1==2
(412 real changes made)

. replace pidr = 2 if der08w1 == 3
(200 real changes made)

. replace pidr = 3 if der08w1 == 4 | der08w1==5 
(398 real changes made)

. replace pidr = 4 if der08w1 == 6
(277 real changes made)

. 
. replace pidr = 0 if der08w19 == 0
(323 real changes made)

. replace pidr = 1 if der08w19 == 1 | der08w19==2
(415 real changes made)

. replace pidr = 2 if der08w19 == 3
(169 real changes made)

. replace pidr = 3 if der08w19 == 4 | der08w19==5 
(403 real changes made)

. replace pidr = 4 if der08w19 == 6
(208 real changes made)

. 
. replace pidr = 0 if der08w17 == 0
(117 real changes made)

. replace pidr = 1 if der08w17 == 1 | der08w17==2
(119 real changes made)

. replace pidr = 2 if der08w17 == 3
(78 real changes made)

. replace pidr = 3 if der08w17 == 4 | der08w17==5 
(136 real changes made)

. replace pidr = 4 if der08w17 == 6
(99 real changes made)

. 
. replace pidr = 0 if der08w9 == 0
(134 real changes made)

. replace pidr = 1 if der08w9 == 1 | der08w9==2
(246 real changes made)

. replace pidr = 2 if der08w9 == 3
(154 real changes made)

. replace pidr = 3 if der08w9 == 4 | der08w9==5 
(212 real changes made)

. replace pidr = 4 if der08w9 == 6
(164 real changes made)

. 
. replace pidr = 0 if der08w11 == 0
(167 real changes made)

. replace pidr = 1 if der08w11 == 1 | der08w11==2
(159 real changes made)

. replace pidr = 2 if der08w11 == 3
(82 real changes made)

. replace pidr = 3 if der08w11 == 4 | der08w11==5 
(149 real changes made)

. replace pidr = 4 if der08w11 == 6
(148 real changes made)

. 
. replace pidr = 0 if der08w10 == 0
(62 real changes made)

. replace pidr = 1 if der08w10 == 1 | der08w10==2
(202 real changes made)

. replace pidr = 2 if der08w10 == 3
(138 real changes made)

. replace pidr = 3 if der08w10 == 4 | der08w10==5 
(199 real changes made)

. replace pidr = 4 if der08w10 == 6
(44 real changes made)

. 
. gen pidr2 = pidr / 4
(1082 missing values generated)

. 
. lab def pidr 0 "Strong Dem" 1 "Weak Dem" 2 "Independent" 3 "Weak Repub" 4 "Strong Repub"

. lab val pidr pidr

. 
. * Strength of PID
. gen pidstr = .
(4240 missing values generated)

. replace pidstr = 0 if pidr==2
(391 real changes made)

. replace pidstr = 1 if pidr==1 | pidr==3
(1534 real changes made)

. replace pidstr = 2 if pidr==0 | pidr==4
(1233 real changes made)

. replace pidstr = pidstr / 2
(2767 real changes made)

. 
. * State of residence
. * The cdstate variable uses different codes than the other variables.
. * The portion of code below makes them match.
. 
. gen state = .
(4240 missing values generated)

. replace state = 21 if cdstate==11
(21 real changes made)

. replace state = 31 if cdstate==12
(17 real changes made)

. replace state = 47 if cdstate==13
(4 real changes made)

. replace state = 23 if cdstate==14
(83 real changes made)

. replace state = 41 if cdstate==15
(10 real changes made)

. replace state = 8 if cdstate==16
(58 real changes made)

. replace state = 34 if cdstate==21
(207 real changes made)

. replace state = 32 if cdstate==22
(94 real changes made)

. replace state = 40 if cdstate==23
(188 real changes made)

. replace state = 37 if cdstate==31
(178 real changes made)

. replace state = 16 if cdstate==32
(90 real changes made)

. replace state = 15 if cdstate==33
(158 real changes made)

. replace state = 24 if cdstate==34
(160 real changes made)

. replace state = 51 if cdstate==35
(105 real changes made)

. replace state = 25 if cdstate==41
(98 real changes made)

. replace state = 17 if cdstate==42
(48 real changes made)

. replace state = 27 if cdstate==43
(111 real changes made)

. replace state = 36 if cdstate==44
(16 real changes made)

. replace state = 43 if cdstate==45
(15 real changes made)

. replace state = 29 if cdstate==46
(33 real changes made)

. replace state = 18 if cdstate==47
(39 real changes made)

. replace state = 9 if cdstate==51
(6 real changes made)

. replace state = 22 if cdstate==52
(71 real changes made)

. replace state = 10 if cdstate==53
(15 real changes made)

. replace state = 48 if cdstate==54
(77 real changes made)

. replace state = 50 if cdstate==55
(22 real changes made)

. replace state = 35 if cdstate==56
(111 real changes made)

. replace state = 42 if cdstate==57
(55 real changes made)

. replace state = 12 if cdstate==58
(120 real changes made)

. replace state = 11 if cdstate==59
(189 real changes made)

. replace state = 19 if cdstate==61
(53 real changes made)

. replace state = 44 if cdstate==62
(83 real changes made)

. replace state = 2 if cdstate==63
(62 real changes made)

. replace state = 26 if cdstate==64
(32 real changes made)

. replace state = 5 if cdstate==71
(23 real changes made)

. replace state = 20 if cdstate==72
(56 real changes made)

. replace state = 38 if cdstate==73
(38 real changes made)

. replace state = 45 if cdstate==74
(241 real changes made)

. replace state = 28 if cdstate==81
(15 real changes made)

. replace state = 14 if cdstate==82
(20 real changes made)

. replace state = 52 if cdstate==83
(5 real changes made)

. replace state = 7 if cdstate==84
(88 real changes made)

. replace state = 33 if cdstate==85
(36 real changes made)

. replace state = 4 if cdstate==86
(65 real changes made)

. replace state = 46 if cdstate==87
(32 real changes made)

. replace state = 30 if cdstate==88
(19 real changes made)

. replace state = 49 if cdstate==91
(84 real changes made)

. replace state = 39 if cdstate==92
(40 real changes made)

. replace state = 6 if cdstate==93
(426 real changes made)

. replace state = 3 if cdstate==94
(6 real changes made)

. replace state = 13 if cdstate==95
(15 real changes made)

. 
. * Replace the cdstate coding with the more desirable ones, if they are avaiable
. replace state = w1b3_b3state if w1b3_b3state>0 & w1b3_b3state<53
(9 real changes made)

. replace state = w1y1 if w1y1>0 & w1y1<53
(1 real change made)

. replace state = w1state if w1state>0 & w1state<53
(60 real changes made)

. replace state = w1b2b_b2state if w1b2b_b2state>0 & w1b2b_b2state<53
(3 real changes made)

. replace state = w2b2b_b2state if w2b2b_b2state>0 & w2b2b_b2state<53
(5 real changes made)

. replace state = w2b3_b3state if w2b3_b3state>0 & w2b3_b3state<53
(2 real changes made)

. replace state = w2state if w2state>0 & w2state<53
(15 real changes made)

. replace state = w2b2b_b2state if w2b2b_b2state>0 & w2b2b_b2state<53
(2 real changes made)

. replace state = w6b3_b3state if w6b3_b3state>0 & w6b3_b3state<53
(4 real changes made)

. replace state = w6b2b_b2state if w6b2b_b2state>0 & w6b2b_b2state<53
(16 real changes made)

. replace state = w9b3_b3state if w9b3_b3state>0 & w9b3_b3state<53
(10 real changes made)

. replace state = w9b2b_b2state if w9b2b_b2state>0 & w9b2b_b2state<53
(15 real changes made)

. replace state = w9zw1 if w9zw1>0 & w9zw1<53
(10 real changes made)

. replace state = w10zw1 if w10zw1>0 & w10zw1<53
(2 real changes made)

. 
. * Region
. gen region = .
(4240 missing values generated)

. * Northeast
. replace region = 1 if state==8
(59 real changes made)

. replace region = 1 if state==21
(22 real changes made)

. replace region = 1 if state==23
(83 real changes made)

. replace region = 1 if state==31
(17 real changes made)

. replace region = 1 if state==32
(96 real changes made)

. replace region = 1 if state==34
(211 real changes made)

. replace region = 1 if state==40
(194 real changes made)

. replace region = 1 if state==41
(10 real changes made)

. replace region = 1 if state==47
(4 real changes made)

. 
. * North central
. replace region = 2 if state==15
(161 real changes made)

. replace region = 2 if state==16
(91 real changes made)

. replace region = 2 if state==17
(48 real changes made)

. replace region = 2 if state==18
(39 real changes made)

. replace region = 2 if state==24
(160 real changes made)

. replace region = 2 if state==25
(100 real changes made)

. replace region = 2 if state==27
(111 real changes made)

. replace region = 2 if state==29
(33 real changes made)

. replace region = 2 if state==36
(16 real changes made)

. replace region = 2 if state==43
(15 real changes made)

. replace region = 2 if state==37
(179 real changes made)

. replace region = 2 if state==51
(104 real changes made)

. 
. * Deep south 
. replace region = 3 if state==2
(63 real changes made)

. replace region = 3 if state==11
(196 real changes made)

. replace region = 3 if state==12
(125 real changes made)

. replace region = 3 if state==20
(58 real changes made)

. replace region = 3 if state==26
(33 real changes made)

. replace region = 3 if state==35
(109 real changes made)

. replace region = 3 if state==42
(53 real changes made)

. replace region = 3 if state==44
(84 real changes made)

. replace region = 3 if state==45
(241 real changes made)

. replace region = 3 if state==48
(78 real changes made)

. replace region = 3 if state==5
(23 real changes made)

. 
. * Peripheral south
. gen periphsouth = 0

. replace periphsouth = 1 if state==9
(6 real changes made)

. replace periphsouth = 1 if state==10
(15 real changes made)

. replace periphsouth = 1 if state==19
(53 real changes made)

. replace periphsouth = 1 if state==22
(73 real changes made)

. replace periphsouth = 1 if state==38
(40 real changes made)

. replace periphsouth = 1 if state==50
(21 real changes made)

. 
. replace region = 3 if periphsouth==1
(208 real changes made)

. 
. * West
. replace region = 4 if state==3
(6 real changes made)

. replace region = 4 if state==4
(63 real changes made)

. replace region = 4 if state==6
(430 real changes made)

. replace region = 4 if state==7
(88 real changes made)

. replace region = 4 if state==13
(15 real changes made)

. replace region = 4 if state==14
(19 real changes made)

. replace region = 4 if state==28
(15 real changes made)

. replace region = 4 if state==33
(38 real changes made)

. replace region = 4 if state==30
(19 real changes made)

. replace region = 4 if state==39
(45 real changes made)

. replace region = 4 if state==46
(34 real changes made)

. replace region = 4 if state==49
(83 real changes made)

. replace region = 4 if state==52
(7 real changes made)

. 
. label define region 1 "Northeast" 2 "North Central" 3 "South" 4 "West"

. label values region region

. 
. * Education
. gen educ2 = der05

. replace educ2 = . if der05==-6
(890 real changes made, 890 to missing)

. replace educ2 = . if der05==-2
(128 real changes made, 128 to missing)

. gen educ = (educ2-1)/4
(1018 missing values generated)

. 
. replace educ2 = educ2 - 1
(3222 real changes made)

. lab def educ2 0 "No HS" 1 "Diploma" 2 "Some col" 3 "BA" 4 "Adv. Degree"

. lab val educ2 educ2

. 
. * Racial resentment
. 
. gen rr1 = 5 - w20l1 if w20l1>0
(1963 missing values generated)

. gen rr2 = w20l2 - 1 if w20l2>0
(1962 missing values generated)

. gen rr3 = w20l3 - 1 if w20l3>0
(1964 missing values generated)

. gen rr4 = 5 - w20l4 if w20l4>0
(1962 missing values generated)

. 
. gen resent2 = rr1 + rr2 + rr3 + rr4
(1969 missing values generated)

. gen resent = resent2 / 16
(1969 missing values generated)

. gen resentx = (resent*2)-1
(1969 missing values generated)

. 
. * Stereotyping
. foreach var of varlist w20m2 w20m3 w20m4 w20m9 w20m10 w20m11 {
  2.         recode `var' (-7 -6 -5 -4 = .) (1 = 4) (2 = 3) (3 = 2) (4 = 1) (5 = 0)
  3.         }
(w20m2: 4240 changes made)
(w20m3: 4240 changes made)
(w20m4: 4240 changes made)
(w20m9: 4240 changes made)
(w20m10: 4240 changes made)
(w20m11: 4240 changes made)

. 
. alpha w20m2 w20m3 w20m4, gen(bposstereo)

Test scale = mean(unstandardized items)

Average interitem covariance:     .5193831
Number of items in the scale:            3
Scale reliability coefficient:      0.8466

. alpha w20m9 w20m10 w20m11, gen(wposstereo)

Test scale = mean(unstandardized items)

Average interitem covariance:     .4665775
Number of items in the scale:            3
Scale reliability coefficient:      0.8424

. 
. * Negative traits
. foreach var of varlist w20m5 w20m6 w20m7 w20m8 w20m12 w20m13 w20m14 w20m15 {
  2.         recode `var' (-7 -6 -5 -4 = .) (1 = 4) (2 = 3) (3 = 2) (4 = 1) (5 = 0)
  3.         }
(w20m5: 4240 changes made)
(w20m6: 4240 changes made)
(w20m7: 4240 changes made)
(w20m8: 4240 changes made)
(w20m12: 4240 changes made)
(w20m13: 4240 changes made)
(w20m14: 4240 changes made)
(w20m15: 4240 changes made)

. 
. alpha w20m5 w20m6 w20m7 w20m8, gen(bnegstereo) 

Test scale = mean(unstandardized items)

Average interitem covariance:     .6734798
Number of items in the scale:            4
Scale reliability coefficient:      0.8602

. alpha w20m12 w20m13 w20m14 w20m15, gen(wnegstereo) 

Test scale = mean(unstandardized items)

Average interitem covariance:     .5086448
Number of items in the scale:            4
Scale reliability coefficient:      0.8446

. 
. replace bposstereo = bposstereo / 4
(2152 real changes made)

. replace wposstereo = wposstereo / 4
(2169 real changes made)

. replace bnegstereo = bnegstereo / 4
(1920 real changes made)

. replace wnegstereo = wnegstereo / 4
(1969 real changes made)

. 
. gen bstereo = bnegstereo - bposstereo 
(1975 missing values generated)

. gen wstereo = wnegstereo - wposstereo
(1977 missing values generated)

. gen stereodif = (bstereo - wstereo)/2
(1978 missing values generated)

. 
. 
. * Fair jobs policy
. gen fairjobw11 = .
(4240 missing values generated)

. replace fairjobw11 = 0 if w11zb2a==1
(802 real changes made)

. replace fairjobw11 = 1 if w11zb2a==2
(497 real changes made)

. replace fairjobw11 = 2 if w11zb2a==3
(91 real changes made)

. replace fairjobw11 = 4 if w11zb2b==3
(31 real changes made)

. replace fairjobw11 = 5 if w11zb2b==2
(146 real changes made)

. replace fairjobw11 = 6 if w11zb2b==1
(282 real changes made)

. replace fairjobw11 = 3 if w11zb1==3
(812 real changes made)

. replace fairjobw11 = fairjobw11 / 6
(1859 real changes made)

. 
. * Hiring policy
. gen hiringw11 = .
(4240 missing values generated)

. replace hiringw11 = 0 if w11n15_b == 1
(121 real changes made)

. replace hiringw11 = 1 if w11n15_b == 2
(131 real changes made)

. replace hiringw11 = 2 if w11n15_b == 3
(41 real changes made)

. replace hiringw11 = 4 if w11n15_c == 3
(67 real changes made)

. replace hiringw11 = 5 if w11n15_c == 2
(426 real changes made)

. replace hiringw11 = 6 if w11n15_c == 1
(1115 real changes made)

. replace hiringw11 = 3 if w11n15_a == 3
(763 real changes made)

. replace hiringw11 = hiringw11 / 6
(2543 real changes made)

. 
. * Health care opinions
. gen medcarew1 = .
(4240 missing values generated)

. replace medcarew1 = 0 if w1p_f_14==1
(459 real changes made)

. replace medcarew1 = 1 if w1p_f_14==2
(189 real changes made)

. replace medcarew1 = 2 if w1p_f_14==3
(22 real changes made)

. replace medcarew1 = 4 if w1p_o_14==3
(15 real changes made)

. replace medcarew1 = 5 if w1p_o_14==2
(195 real changes made)

. replace medcarew1 = 6 if w1p_o_14==1
(377 real changes made)

. replace medcarew1 = 3 if w1p13==3
(355 real changes made)

. replace medcarew1 = medcarew1 / 6
(1153 real changes made)

. 
. gen medcarew10 = .
(4240 missing values generated)

. replace medcarew10 = 0 if w10p14_favor==1
(328 real changes made)

. replace medcarew10 = 1 if w10p14_favor==2
(167 real changes made)

. replace medcarew10 = 2 if w10p14_favor==3
(30 real changes made)

. replace medcarew10 = 4 if w10p14_oppose==3
(33 real changes made)

. replace medcarew10 = 5 if w10p14_oppose==2
(172 real changes made)

. replace medcarew10 = 6 if w10p14_oppose==1
(340 real changes made)

. replace medcarew10 = 3 if w10p13==3
(278 real changes made)

. replace medcarew10 = medcarew10 / 6
(1020 real changes made)

. 
. 
. * Liking of Obama in waves 9 and 10
. gen dislikeobw9 = .
(4240 missing values generated)

. replace dislikeobw9 = 0 if w9e39==1
(623 real changes made)

. replace dislikeobw9 = 1 if w9e39==2
(549 real changes made)

. replace dislikeobw9 = 2 if w9e39==3
(116 real changes made)

. replace dislikeobw9 = 4 if w9e40==3
(66 real changes made)

. replace dislikeobw9 = 5 if w9e40==2
(224 real changes made)

. replace dislikeobw9 = 6 if w9e40==1
(435 real changes made)

. replace dislikeobw9 = 3 if w9e38==3
(729 real changes made)

. replace dislikeobw9 = dislikeobw9 / 6
(2119 real changes made)

. 
. gen dislikeobw10 = .
(4240 missing values generated)

. replace dislikeobw10 = 0 if w10e39==1
(602 real changes made)

. replace dislikeobw10 = 1 if w10e39==2
(578 real changes made)

. replace dislikeobw10 = 2 if w10e39==3
(155 real changes made)

. replace dislikeobw10 = 4 if w10e40==3
(70 real changes made)

. replace dislikeobw10 = 5 if w10e40==2
(206 real changes made)

. replace dislikeobw10 = 6 if w10e40==1
(406 real changes made)

. replace dislikeobw10 = 3 if w10e38==3
(674 real changes made)

. replace dislikeobw10 = dislikeobw10 / 6
(2089 real changes made)

. 
. gen obsupsum = 1 - ((dislikeobw9 + dislikeobw10) / 2)
(1738 missing values generated)

. 
. * Approval of Obama in July 2009
. gen obdisapw19 = .
(4240 missing values generated)

. replace obdisapw19 = 0 if w19ws_a_2==1
(336 real changes made)

. replace obdisapw19 = 1 if w19ws_a_2==2
(555 real changes made)

. replace obdisapw19 = 2 if w19ws_a_2==3
(209 real changes made)

. replace obdisapw19 = 4 if w19ws_d_2==3
(106 real changes made)

. replace obdisapw19 = 5 if w19ws_d_2==2
(241 real changes made)

. replace obdisapw19 = 6 if w19ws_d_2==1
(380 real changes made)

. replace obdisapw19 = 3 if w19ws1==3
(556 real changes made)

. replace obdisapw19 = obdisapw19 / 6
(2047 real changes made)

. 
. * Obama's religion
. gen obreligw11 = w11wv3

. replace obreligw11 = . if w11wv3==-7 | w11wv3==-6 | w11wv3==-5 
(1595 real changes made, 1595 to missing)

. gen obmuslimw11 = .
(4240 missing values generated)

. replace obmuslimw11 = 1 if obreligw11==3
(523 real changes made)

. replace obmuslimw11 = 0 if obreligw11==1 | obreligw11==2 | obreligw11==4 | obreligw11==5
(2122 real changes made)

. 
. * Political knowledge
. * Wave 2
. gen knowlw2q1 = 0

. gen knowlw2q2 = 0

. gen knowlw2q3 = 0

. gen knowlw2q4 = 0

. gen knowlw2q5 = 0

. gen knowlw2q6 = 0

. 
. replace knowlw2q1 = 1 if w2u2 == 2
(1351 real changes made)

. replace knowlw2q2 = 1 if w2u3 == 6
(547 real changes made)

. replace knowlw2q3 = 1 if w2u4 == 2
(1068 real changes made)

. replace knowlw2q4 = 1 if w2u5 == 2
(568 real changes made)

. replace knowlw2q5 = 1 if w2u6 == 3
(994 real changes made)

. replace knowlw2q6 = 1 if w2u7 == 2
(1040 real changes made)

. 
. gen knowl2w2 = knowlw2q1 + knowlw2q2 + knowlw2q3 + knowlw2q4 + knowlw2q5 + knowlw2q6

. recode knowl2w2 (0 = .) if w2u2==-6 | w2u2==-5 // Non-responses
(knowl2w2: 2783 changes made)

. gen knowlw2 = knowl2w2 / 6
(2783 missing values generated)

. 
. * Wave 11
. gen knowlw11q1 = 0

. gen knowlw11q2 = 0

. gen knowlw11q3 = 0

. gen knowlw11q4 = 0

. gen knowlw11q5 = 0

. gen knowlw11q6 = 0

. 
. replace knowlw11q1 = 1 if w11wv7 == 2
(1128 real changes made)

. replace knowlw11q2 = 1 if w11wv8 == 6
(445 real changes made)

. replace knowlw11q3 = 1 if w11wv9 == 2
(863 real changes made)

. replace knowlw11q4 = 1 if w11wv10 == 2
(497 real changes made)

. replace knowlw11q5 = 1 if w11wv11 == 3
(828 real changes made)

. replace knowlw11q6 = 1 if w11wv12 == 2
(871 real changes made)

. 
. gen knowl2w11 = knowlw11q1 + knowlw11q2 + knowlw11q3 + knowlw11q4 + knowlw11q5 + knowlw11q
> 6

. recode knowl2w11 (0 = .) if w11wv7==-6 | w11wv7==-5 | w11wv7==-1 // Non-responses
(knowl2w11: 3057 changes made)

. gen knowlw11 = knowl2w11 / 6
(3057 missing values generated)

. 
. gen knowlsum = max(knowlw2, knowlw11)
(1614 missing values generated)

. 
. 
. save "panel_working.dta", replace
file panel_working.dta saved

. 
. 
end of do-file

. log close
      name:  <unnamed>
       log:  /Users/TJRyan/Dropbox/Summer work/Kinder/Replication files/panel_coding.log
  log type:  text
 closed on:  11 Aug 2015, 11:36:30
--------------------------------------------------------------------------------------------
